<?php
function dump($obj, $what = NULL) {
  if (defined ('DEBUG_ENABLED') && ! DEBUG_ENABLED) {
    return;
  }
  echo "<pre>\n";
  if (is_null ($obj)) {
    echo ($what !== NULL) ? "$what=!NULL!" : '!NULL!';
  } else if ($obj === '') {
    echo ($what !== NULL) ? "$what=!EMPTY!" : '!EMPTY!';
  } else if ($obj === false) {
    echo ($what !== NULL) ? "$what=!FALSE!" : '!FALSE!';
  } else {
    if ($what !== NULL) {
      echo "$what=<br>";
    }
    echo htmlspecialchars (print_r ($obj, true));
  }
  echo "</pre>\n";
}

function getParam($itm, $default = '', $trimText = false) {
  if (isset($_POST[$itm])) {
    return ($trimText) ? trim($_POST[$itm]) : $_POST[$itm];
  } else if (isset($_GET[$itm])) {
    return ($trimText) ? trim($_GET[$itm]) : $_GET[$itm];
  } else {
    return $default;
  }
}
?>